import React from 'react'
import { Switch, Route } from 'react-router-dom'
import Home from './Home/home'
import Blog from './Blog/blog'
import UserInfo from './UserInfo/userInfo'

function Main(props) {
  return (
    <div className="Main">
      <Switch>
        <Route path="/blog">
          <Blog
            userInfo={props.userInfo}
            onTabChange={props.onTabChange}
            headerHeight={props.headerHeight} />
        </Route>
        <Route path="/userinfo">
          <UserInfo
            onTabChange={props.onTabChange}
            userInfo={props.userInfo}
            setUserInfo={props.setUserInfo} />
        </Route>
        <Route path="/">
          <Home onTabChange={props.onTabChange} />
        </Route>
      </Switch>
    </div>
  )
}

export default Main;